package com.sgs.carbon.starter.dict.core.util;

import com.sgs.carbon.starter.dict.core.dto.DictDataRespDTO;
import com.sgs.carbon.starter.dict.core.service.DictDataService;
import lombok.extern.slf4j.Slf4j;

/**
 * 字典工具类
 *
 * @author Dave Liu
 * @date 2021-10-02
 */
@Slf4j
public class DictUtils {

    private static DictDataService service;

    public static void init(DictDataService service) {
        DictUtils.service = service;
        log.info("[init][初始化 DictUtils 成功]");
    }

    public static DictDataRespDTO getDictDataFromCache(String type, String value) {
        return service.getDictDataFromCache(type, value);
    }

    public static DictDataRespDTO parseDictDataFromCache(String type, String label) {
        return service.parseDictDataFromCache(type, label);
    }

}
